<?php $this->load->view('inc/header.php');?>
<?php html_jscss('uploadify/uploadify.css');?>
<?php html_js('uploadify/jquery.uploadify-3.1.min.js');?>

<div class="b2"></div>

<div class="panel w2">
<?php $this->load->view('user/inc_nav.php');?>
<div class="b2"></div>
		
	<table class="tbl-frm-1">
		
		<tr>
			<td>
        		<div id="udf-query-avatar" class="avatar-pview">
        		</div>
			</td>
			<td width="220">
        		<input type="file" id="udf-avatar" />
				<div class="b2"></div>
        		<div id="mdl-avatar">
        			<?php html_img('gravatar.jpg','width="200"');?>
        		</div>
			</td>
		</tr>
	</table>
	<div class="action">
		<input class="btn-ajax-submit btn-4" frmid="frm-setting_basic" type="button" value="保 存"/>
	</div>
</div>
<?php $this->load->view('inc/footer.php');?>

<script>$(function(){
    $('#udf-avatar').uploadify({
        'swf'      : '<?php echo $static_url;?>/js/uploadify/uploadify.swf',
        'uploader' : '<?php echo site_url('c=cm&m=avatar');?>',
        'buttonClass' : 'btn-uploadify',
        'multi': false,
        'progressData':'speed', 
        'preventCaching':false,
        'queueSizeLimit':0,
        'transparent': false,
        'onUploadSuccess' : function(file, data, response){
            console.info(data);
            return;
            var data = eval('('+data+')');
            /*
            var img_str = '<img width="100" height="100" src="'+data.spath+'"/>';
            $('#udf-query-avatar').html('').append(img_str);
            */
        },
		'width':108,
		'height':35,
		'buttonText':'本地上传',
        'onUploadStart':function(){
            /*
        	$('#fileQueue').html('');
        	$('#fileQueue').addClass('uploading');
        	*/
        }
    }); 
});</script>
